
#ifndef __SERIAL_BLOCK_SOURCE_H
#define __SERIAL_BLOCK_SOURCE_H

#include <apr-1/apr_pools.h>
#include <apr-1/apr_thread_proc.h>
#include "../db/KeyDB.h"

class SerialBlockSource
{
   public:
      SerialBlockSource(const char *directorypath, apr_pool_t *imp);
      ~SerialBlockSource();
      char *GetNextBlock(int *realsize);
      char *GetNextBlockEncrypted(const char *cname, KeyPair *kp, int *realsize, int *cesize, char **hash);
      char *GetNextBlockEncrypted(const char *encwith, KeyDB *kdb, int *realsize, int *cesize, char **hash);
   private:
      char *directory_name;
      apr_pool_t *mp;
      apr_procattr_t *pattr;
      apr_proc_t tproc;
};

#endif
